<script setup lang="ts">
import {ref} from 'vue'
// 模拟按钮权限校验，权限不足隐藏按钮，反之显示
const permission = ref("user:add");
/*******************************************************/
/**
 * 自定义局部指令：以变量的形式声明
 *  指令名必须以v开头并且遵循驼峰命名
 */
const vPermission = {
    mounted: (el, binding) => {
        console.log(el, binding);
    },
    updated: () => {
        console.log("测试");
    }
}


</script>
<template>
    <div>
        <!-- <input v-focus type="text"> -->
        <button v-auth="permission">新增</button>
        <button v-permission>局部指令测试</button>
    </div>
</template>

<style scoped>

</style>